#ifndef WATER_LEVEL_H
#define WATER_LEVEL_H

#include <avr/pgmspace.h>
#include "Arduino.h"

#include <LiquidCrystal.h>
#include <EEPROM.h>

#include "Clock.h";
#include "Aquarium_Modes.h"
#include "utility.h";


const int Water_Change_Bottom_Float_Pin_IN = A12;
const int Water_Level_Top_Float_Pin_IN = A14;
const int Water_Level_Bottom_Float_Pin_IN = A15;

const int Water_Level_Osmosis_Refull_Pin_OUT = 11;


const byte OSMOSIS_REFUL_MODE_OFF   = 0;
const byte OSMOSIS_REFUL_MODE_ON    = 1;
const byte OSMOSIS_REFUL_MODE_AUTO  = 2;



class Water_Level
{

public:

  void init();
  void Save_To_EEPROM();
  void update();
  void Clear_Alerts();

  byte Get_Number_Of_Print_Alerts();
  void Print_Alerts(byte Line);


  void Set_OnOff( bool _OnOff){
    OnOff = _OnOff;
  }
  
  byte Get_OnOff(){
    return OnOff;
  }
  
  
  void Set_Modes( byte _Modes){
    Modes = _Modes;
  }
  
  byte Get_Modes(){
    return Modes;
  }
  
  void Set_Osmosis_Refull_OnOff( byte _OnOff){
    Osmosis_Refull_OnOff = _OnOff;
  }
  
  byte Get_Osmosis_Refull_OnOff(){
    return Osmosis_Refull_OnOff;
  }
  
  
  void Set_Osmosis_Refull_Modes( byte _Modes){
    Osmosis_Refull_Modes = _Modes;
  }
  
  byte Get_Osmosis_Refull_Modes(){
    return Osmosis_Refull_Modes;
  }
  
  
  

  
  byte Is_There_Alerts(){
    return   Top_Float_Alert + Bottom_Float_Alert;
  }


  bool Is_Water_Change_Bottom_Float_On();

  bool Is_Top_Float_On();
  bool Is_Bottom_Float_On();

  void  Print_Float_Name(byte Float_Num);
  bool  Get_Float_Status(byte Float_Num);

  bool Check_Osmosis_Refull_Modes(byte Mode);
  void stop_Osmosis_Refull();
  void resume_Osmosis_Refull();
  
private:  
  
  bool Check_Modes(byte Mode);

  bool OnOff;
  byte Modes;


  byte Osmosis_Refull_OnOff;
  byte Osmosis_Refull_Modes;
  
  
  byte Top_Float_Alert;
  byte Bottom_Float_Alert;



};


#endif










